package com.ljh.SimpleTradingSystem.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class LogoutController {
    @Resource
    HttpServletRequest req;

    @RequestMapping("/logout")
    public String logout() {
        HttpSession session = req.getSession();
        session.removeAttribute("userId");
        return "GoodsList";
    }
}
